import request from "@/utils/request";

// 总数据
export function getArtilceAll(page = 1, pageSize = 3, options = {}) {
  return request({
    url: '/api/article',
    params: {
      page,
      pageSize,
      ...options
    }
  })
}

// 删除接口
export function getArtilceDel(id) {
  console.log(id)
  return request.delete(`/api/article/${id}`)
}

// 分类管理接口
export function getClassify() {
  return request({
    url: `/api/category`
  })
}


// 添加分类接口
export function getKind(obj) {
  return request({
    url: `/api/category`,
    method: 'post',
    data:obj
  });
}



//删除分类管理接口
export function getClassifyDel(id){
  return request({
    url:`/api/category/${id}`,
    method: 'delete',
  })
}

//更新分类接口
export function getUpdate(obj){
  console.log(obj);
  return request({
    url:`/api/category/${obj.id}`,
    method: 'patch',
    data:{label:obj.label,value:obj.value}
  })
}

// /api/article/  patch
